import 'package:flutter/material.dart';
import 'package:flutter_study_app/app/router/router_param.dart';
import 'package:flutter_study_app/app/router/routers.dart';
import 'package:flutter_study_app/widget/my_app_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class MarketingSectionPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _MarketingSectionPageState();
}

class _MarketingSectionPageState extends State<MarketingSectionPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MyAppBar(
        title: '营销专区',
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            GestureDetector(
              onTap: () {
                Routers.navigateTo(context, Routers.storageSpecialRegionPage);
              },
              child: Container(
                width: double.infinity,
                margin: EdgeInsets.only(left: 12.w, right: 12.w, top: 12.w),
                child: Stack(
                  children: [
                    AspectRatio(
                      aspectRatio: 1011 / 395,
                      child: Image.asset(
                        'assets/images/ic_marketing_limit_1.png',
                        fit: BoxFit.fitWidth,
                      ),
                    ),
                    Positioned(
                      left: 16.w,
                      top: 16.w,
                      child: Text(
                        '额度支用专区',
                        style: TextStyle(
                            color: Color(0xFF7F521A), fontSize: 25.sp),
                      ),
                    ),
                    Positioned(
                      top: 16.w,
                      left: 160.w,
                      child: Container(
                        width: 30.w,
                        height: 15.w,
                        alignment: Alignment.center,
                        decoration: BoxDecoration(
                            borderRadius: BorderRadius.only(
                              topLeft: Radius.circular(12.w),
                              topRight: Radius.circular(8.w),
                              bottomLeft: Radius.zero,
                              bottomRight: Radius.circular(8.w),
                            ),
                            gradient: LinearGradient(
                                begin: Alignment.topCenter,
                                end: Alignment.bottomCenter,
                                colors: [
                                  Color(0xFFFF7F7F),
                                  Color(0xFFFF4227)
                                ])),
                        child: Text(
                          '222',
                          style:
                              TextStyle(color: Colors.white, fontSize: 10.sp),
                        ),
                      ),
                    ),
                    Positioned(
                      left: 16.w,
                      bottom: 16.w,
                      child: GestureDetector(
                        onTap: () {
                          Routers.navigateTo(
                              context, Routers.storageSpecialRegionPage);
                        },
                        child: Container(
                          width: 96.w,
                          height: 36.w,
                          alignment: Alignment.center,
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(18.w),
                              gradient: LinearGradient(
                                  begin: Alignment.topCenter,
                                  end: Alignment.bottomCenter,
                                  colors: [
                                    Color(0xFFFCB06D),
                                    Color(0xFFFF7417)
                                  ])),
                          child: Text(
                            '立即查看',
                            textAlign: TextAlign.center,
                            style:
                                TextStyle(color: Colors.white, fontSize: 16.sp),
                          ),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ),
            GestureDetector(
              onTap: () {
                RouterParam param = RouterParam();
                param.putInt("type", 1);
                Routers.navigateTo(context, Routers.storageSpecialRegionPage,
                    param: param);
              },
              child: Container(
                width: double.infinity,
                margin: EdgeInsets.only(left: 12.w, right: 12.w, top: 12.w),
                child: Stack(
                  children: [
                    AspectRatio(
                      aspectRatio: 1011 / 395,
                      child: Image.asset(
                        'assets/images/ic_marketing_limit_2.png',
                        fit: BoxFit.fitWidth,
                      ),
                    ),
                    Positioned(
                      left: 16.w,
                      top: 16.w,
                      child: Text(
                        '额度续存专区',
                        style: TextStyle(
                            color: Color(0xFF7F521A), fontSize: 25.sp),
                      ),
                    ),
                    Positioned(
                      top: 16.w,
                      left: 160.w,
                      child: Container(
                        width: 30.w,
                        height: 15.w,
                        alignment: Alignment.center,
                        decoration: BoxDecoration(
                            borderRadius: BorderRadius.only(
                              topLeft: Radius.circular(12.w),
                              topRight: Radius.circular(8.w),
                              bottomLeft: Radius.zero,
                              bottomRight: Radius.circular(8.w),
                            ),
                            gradient: LinearGradient(
                                begin: Alignment.topCenter,
                                end: Alignment.bottomCenter,
                                colors: [
                                  Color(0xFFFF7F7F),
                                  Color(0xFFFF4227)
                                ])),
                        child: Text(
                          '222',
                          style:
                              TextStyle(color: Colors.white, fontSize: 10.sp),
                        ),
                      ),
                    ),
                    Positioned(
                      left: 16.w,
                      bottom: 16.w,
                      child: GestureDetector(
                        onTap: () {
                          RouterParam param = RouterParam();
                          param.putInt("type", 1);
                          Routers.navigateTo(
                              context, Routers.storageSpecialRegionPage,
                              param: param);
                        },
                        child: Container(
                          width: 96.w,
                          height: 36.w,
                          alignment: Alignment.center,
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(18.w),
                              gradient: LinearGradient(
                                  begin: Alignment.topCenter,
                                  end: Alignment.bottomCenter,
                                  colors: [
                                    Color(0xFFFF7F7F),
                                    Color(0xFFFF4227)
                                  ])),
                          child: Text(
                            '立即查看',
                            textAlign: TextAlign.center,
                            style:
                                TextStyle(color: Colors.white, fontSize: 16.sp),
                          ),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ),
            GestureDetector(
              onTap: () {
                Routers.navigateTo(context, Routers.onlineLendWhiteListPage);
              },
              child: Container(
                width: double.infinity,
                margin: EdgeInsets.only(left: 12.w, right: 12.w, top: 12.w),
                child: Stack(
                  children: [
                    AspectRatio(
                      aspectRatio: 1011 / 395,
                      child: Image.asset(
                        'assets/images/ic_marketing_lend.png',
                        fit: BoxFit.fitWidth,
                      ),
                    ),
                    Positioned(
                      left: 16.w,
                      top: 16.w,
                      child: Text(
                        '网贷白名单专区',
                        style: TextStyle(
                            color: Color(0xFF2D3865), fontSize: 25.sp),
                      ),
                    ),
                    Positioned(
                      top: 16.w,
                      left: 180.w,
                      child: Container(
                        width: 30.w,
                        height: 15.w,
                        alignment: Alignment.center,
                        decoration: BoxDecoration(
                            borderRadius: BorderRadius.only(
                              topLeft: Radius.circular(12.w),
                              topRight: Radius.circular(8.w),
                              bottomLeft: Radius.circular(0.w),
                              bottomRight: Radius.circular(8.w),
                            ),
                            gradient: LinearGradient(
                                begin: Alignment.topCenter,
                                end: Alignment.bottomCenter,
                                colors: [
                                  Color(0xFFFF7F7F),
                                  Color(0xFFFF4227)
                                ])),
                        child: Text(
                          '222',
                          style:
                              TextStyle(color: Colors.white, fontSize: 10.sp),
                        ),
                      ),
                    ),
                    Positioned(
                      left: 16.w,
                      bottom: 16.w,
                      child: GestureDetector(
                        onTap: () {
                          Routers.navigateTo(
                              context, Routers.onlineLendWhiteListPage);
                        },
                        child: Container(
                          width: 96.w,
                          height: 36.w,
                          alignment: Alignment.center,
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(18.w),
                              gradient: LinearGradient(
                                  begin: Alignment.topCenter,
                                  end: Alignment.bottomCenter,
                                  colors: [
                                    Color(0xFF648DFF),
                                    Color(0xFF265FEE)
                                  ])),
                          child: Text(
                            '立即查看',
                            textAlign: TextAlign.center,
                            style:
                                TextStyle(color: Colors.white, fontSize: 16.sp),
                          ),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
